home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Networking / SNMP / SNMP Development / MacSNMP Developer 1.0.2 / SNMP Interfaces / SNMPLAP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-15  |  8.4 KB  |  308 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SNMPLAP.h
  3.  
  4.     Contains:    Simple Network Management Protocol C interface for Link Access Protocols
  5.  
  6.     Copyright:    © 1992 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. typedef struct LAPMIBStats
  11.     {
  12.     unsigned long    ifVersion;            /* Version of LinkStats we support */
  13.     Str255            ifDescr;            /* String with info about interface */
  14.     unsigned long    ifType;                /* Code with type of interface */
  15.     unsigned long    ifMaxMTU;            /* Largest size of IP datagram that can be tx/recv */
  16.     unsigned long    ifSpeed;            /* Bandwidth in bits/second */
  17.     Str31            ifPhysAddress;        /* Interface address */
  18.     unsigned long    ifAdminStatus;        /* Desired state (1 = up, 2 = down, 3 = testing) */
  19.     unsigned long    ifOperStatus;        /* Current state (1 = up, 2 = down, 3 = testing) */
  20.     unsigned long    ifLastChange;        /* SysTicks when interface entered current operation state */
  21.     unsigned long    ifInOctets;            /* Total nbr bytes received including framing chars*/
  22.     unsigned long    ifInUcastPkts;        /* Nbr of unicast packets received */
  23.     unsigned long    ifInNUcastPkts;        /* Nbr of broad/multi cast packets received */
  24.     unsigned long    ifInDiscards;        /* Nbr of overwrites that occured */
  25.     unsigned long    ifInErrors;            /* Nbr of pkts recv which contain error */
  26.     unsigned long    ifInUnknownProtos;    /* Nbr of pkts recv discarded cuz of unknown protocol */
  27.     unsigned long    ifOutOctets;        /* Total nbr bytes tx including framing chars */
  28.     unsigned long    ifOutUcastPkts;        /* Nbr of unicast packets tx */
  29.     unsigned long    ifOutNUcastPkts;    /* Nbr of broad/multi cast packets tx */
  30.     unsigned long    ifOutDiscards;        /* Nbr tx pkts discarded */
  31.     unsigned long    ifOutErrors;        /* Nbr tx pkts not sent due to error */
  32.     unsigned long    ifOutQLen;            /* Current nbr of packets in output queue */
  33.     };
  34.  
  35. typedef struct LAPMIBStats LAPMIBStats;
  36.  
  37.  
  38. /* ifAdminStatus and ifOperStatus */
  39. enum                                     
  40.     {
  41.     ifStatusUp            =        1,
  42.     ifStatusDown        =        2,
  43.     ifStatusTesting        =        3
  44.     };
  45.  
  46.  
  47. /* IfTypes */
  48. enum                                     
  49.     {
  50.     other                 =        1,        /* none of the following */
  51.     regular1822            =        2,
  52.     hdh1822                =        3,
  53.     ddn_x25             =        4,
  54.     rfc877_x25             =        5,
  55.     ethernet_csmacd        =        6,
  56.     iso88023_csmacd     =        7,
  57.     iso88024_tokenBus    =        8,
  58.     iso88025_tokenRing     =        9,
  59.     iso88026_man         =        10,
  60.     starLan                =        11,
  61.     proteon_10Mbit         =        12,
  62.     proteon_80Mbit        =        13,
  63.     hyperchannel         =        14,
  64.     fddi                =        15,
  65.     lapb                 =        16,
  66.     sdlc                =        17,
  67.     ds1                    =        18,        /* T-1 */
  68.     e1                    =        19,     /* european equivalent of T-1 */
  69.     basicISDN             =        20,
  70.     primaryISDN         =        21,
  71.     propPointToPointSerial =    22,        /* proprietary serial */
  72.     ppp                    =        23,
  73.     softwareLoopback    =        24,
  74.     eon                    =        25,        /* CLNP over IP */
  75.     ethernet_3Mbit        =        26,
  76.     nsip                =        27,        /* XMS over IP */
  77.     slip                =        28,        /* generic SLIP */
  78.     ultra                =        29,        /* ULTRA technologie
  79.     ds3                    =        30,        /* T-3 */
  80.     sip                    =        31,        /* SMDS */
  81.     frame_relay            =        32
  82.     };
  83.  
  84.  
  85. /*----------------------------------
  86.     EtherNet (802.3) SNMP equates 
  87.   ----------------------------------*/
  88.  
  89. typedef struct Dot3Entry
  90.     {
  91.     unsigned long    dot3Version;                    /* Version of LapDot3 entry that we support */
  92.     unsigned long    dot3Index;                        /* ifIndex for this driver */
  93.     unsigned long    dot3InitializeMac;                /* Init status (1 = inited, 2 = uninited) */
  94.     unsigned long    dot3MacSubLayerStatus;            /* Op status of the MAC sublayer (1 = enabled, 2 = disabled) */
  95.     unsigned long    dot3MulticastReceiveStatus;        /* Multicast receive status (1 = enabled, 2 = disabled) */
  96.     unsigned long    dot3TxEnabled;                    /* MAC frame tx state (1 = enabled, 2 = disabled) */
  97.     unsigned long    dot3TestTdrValue;                /* Time between TDR start/end */
  98.     };
  99.  
  100. typedef struct Dot3Entry Dot3Entry;
  101.  
  102. typedef struct Dot3EntryControl
  103.     {
  104.     unsigned long    dot3EntryControlType;
  105.     union
  106.         {
  107.         unsigned long    dot3Index;
  108.         unsigned long    dot3InitializeMac;
  109.         unsigned long    dot3MacSubLayerStatus;
  110.         unsigned long    dot3MulticastReceiveStatus;
  111.         unsigned long    dot3TxEnabled;
  112.         unsigned long    dot3TestTdrValue;
  113.         } IfExtended;
  114.     };
  115.  
  116. typedef struct Dot3EntryControl Dot3EntryControl;
  117.  
  118. typedef struct Dot3StatsEntry
  119.     {
  120.     unsigned long    dot3StatsVersion;                    /* Version number */
  121.     unsigned long    dot3StatsIndex;                        /* Same as ifIndex (to be left at zero) */
  122.     unsigned long    dot3StatsAlignmentErrors;
  123.     unsigned long    dot3StatsFCSErrors;
  124.     unsigned long    dot3StatsSingleCollisionFrames;
  125.     unsigned long    dot3StatsMultipleCollisionFrames;
  126.     unsigned long    dot3StatsSQETestErrors;
  127.     unsigned long    dot3StatsDeferredTransmissions;
  128.     unsigned long    dot3StatsLateCollisions;
  129.     unsigned long    dot3StatsExcessiveCollisions;
  130.     unsigned long    dot3StatsInternalMacTransmitErrors;
  131.     unsigned long    dot3StatsCarrierSenseErrors;
  132.     unsigned long    dot3StatsExcessiveDeferrals;
  133.     unsigned long    dot3StatsFrameTooLongs;
  134.     unsigned long    dot3StatsInRangeLengthErrors;
  135.     unsigned long    dot3StatsOutOfRangeLengthFields;
  136.     unsigned long    dot3StatsInternalMacReceiveErrors;
  137.     };
  138.  
  139. typedef struct Dot3StatsEntry Dot3StatsEntry;
  140.  
  141. typedef struct Dot3CollEntry
  142.     {
  143.     unsigned long    dot3CollVersion;        /* Version number */
  144.     unsigned long    dot3CollIndex;            /* Same as ifIndex (to be left at zero) */
  145.     unsigned long    dot3CollCount;
  146.     unsigned long    dot3CollFrequencies;
  147.     };
  148.  
  149. typedef struct Dot3CollEntry Dot3CollEntry;
  150.  
  151. /*----------------------------------
  152.     TokenRing (802.5) SNMP equates
  153.   ----------------------------------*/
  154.  
  155. typedef struct Dot5Entry
  156.     {
  157.     unsigned long    dot5Version;            /* Version of LapDot5 entry that we support */
  158.     unsigned long    dot5Index;                /* ifIndex for this driver */
  159.     unsigned long    dot5Commands;            /* always reads as no_op (1) */
  160.     unsigned long    dot5RingStatus;
  161.     unsigned long    dot5RingState;
  162.     unsigned long    dot5RingOpenStatus;
  163.     unsigned long    dot5RingSpeed;
  164.     Str31            dot5UpStream;
  165.     unsigned long    dot5ActMonParticipate;
  166.     unsigned long    dot5Functional;
  167.     };
  168.  
  169. typedef struct Dot5Entry Dot5Entry;
  170.  
  171. typedef struct Dot5EntryControl
  172.     {
  173.     unsigned long    dot5EntryControlType;
  174.     union
  175.         {
  176.         unsigned long    dot5Index;
  177.         unsigned long    dot5Commands;
  178.         unsigned long    dot5RingStatus;
  179.         unsigned long    dot5RingState;
  180.         unsigned long    dot5RingOpenStatus;
  181.         unsigned long    dot5RingSpeed;
  182.         Str31            dot5UpStream;
  183.         unsigned long    dot5ActMonParticipate;
  184.         unsigned long    dot5Functional;
  185.         } IfExtended;
  186.     };
  187.  
  188. typedef struct Dot5EntryControl Dot5EntryControl;
  189.  
  190. typedef struct Dot5StatsEntry
  191.     {
  192.     unsigned long    dot5StatsVersion;                /* Version number */
  193.     unsigned long    dot5StatsIndex;                    /* Same as ifIndex (to be left at zero) */
  194.     unsigned long    dot5StatsLineErrors;
  195.     unsigned long    dot5StatsBurstErrors;
  196.     unsigned long    dot5StatsACErrors;
  197.     unsigned long    dot5StatsAbortTransErrors;
  198.     unsigned long    dot5StatsInternalErrors;
  199.     unsigned long    dot5StatsLostFrameErrors;
  200.     unsigned long    dot5StatsReceiveCongestions;
  201.     unsigned long    dot5StatsFrameCopiedErrors;
  202.     unsigned long    dot5StatsTokenErrors;
  203.     unsigned long    dot5StatsSoftErrors;
  204.     unsigned long    dot5StatsHardErrors;
  205.     unsigned long    dot5StatsSignalLoss;
  206.     unsigned long    dot5StatsTransmitBeacons;
  207.     unsigned long    dot5StatsRecoverys;
  208.     unsigned long    dot5StatsLobeWires;
  209.     unsigned long    dot5StatsRemoves;
  210.     unsigned long    dot5StatsSingles;
  211.     unsigned long    dot5StatsFreqErrors;
  212.     };
  213.  
  214. typedef struct Dot5StatsEntry Dot5StatsEntry;
  215.  
  216. typedef struct Dot5TimerEntry
  217.     {
  218.     unsigned long    dot5TimerVersion;            /* Version number */
  219.     unsigned long    dot5TimerIndex;                /* Same as ifIndex (to be left at zero) */
  220.     unsigned long    dot5TimerReturnRepeat;
  221.     unsigned long    dot5TimerHolding;
  222.     unsigned long    dot5TimerQueuePDU;
  223.     unsigned long    dot5TimerValidTransmit;
  224.     unsigned long    dot5TimerNoToken;
  225.     unsigned long    dot5TimerActiveMon;
  226.     unsigned long    dot5TimerStandbyMon;
  227.     unsigned long    dot5TimerErrorReport;
  228.     unsigned long    dot5TimerBeaconTransmit;
  229.     unsigned long    dot5TimerBeaconReceive;
  230.     };
  231.  
  232. typedef struct Dot5TimerEntry Dot5TimerEntry;
  233.  
  234.  
  235. /* dot3InitializeMac */
  236. enum
  237.     {
  238.     dot3initialized            =        1,
  239.     dot3uninitialized        =        2
  240.     };
  241.     
  242.  
  243. /* dot3SubLayerStatus, dot3MulticastReceiveStatus */
  244. enum
  245.     {
  246.     dot3enabled                =        1,
  247.     dot3disabled            =        2
  248.     };
  249.     
  250.     
  251. /* dot3TxEnabled, dot5ActMonParticipate */
  252. enum
  253.     {
  254.     dot_true            =        1,
  255.     dot_false            =        2
  256.     };
  257.     
  258.  
  259. /* dot5Commands */
  260. enum
  261.     {
  262.     dot5no_op                =        1,
  263.     dot5open                =        2,
  264.     dot5reset                =        3,
  265.     dot5close                =        4
  266.     };
  267.     
  268.  
  269. /* dot5RingState */
  270. enum
  271.     {
  272.     opened                =        1,
  273.     closed                =        2,
  274.     opening                =        3,
  275.     closing                =        4,
  276.     openFailure            =        5,
  277.     ringFailure            =        6
  278.     };
  279.     
  280.  
  281. /* dot5RingOpenStatu
  282. enum
  283.     {
  284.     noOpen                =        1,
  285.     badParam            =        2,
  286.     lobeFailed            =        3,
  287.     signalLoss            =        4,
  288.     insertionTimeout    =        5,
  289.     ringFailed            =        6,
  290.     beaconing            =        7,
  291.     duplicateMAC        =        8,
  292.     requestFailed        =        9,
  293.     removeReceived        =        10,
  294.     ringopen            =        11
  295.     };
  296.     
  297.  
  298. /* dot5RingSpeed */
  299. enum
  300.     {
  301.     unknown                =        1,
  302.     oneMegabit            =        2,
  303.     fourMegabit            =        3,
  304.     sixteenMegabit        =        4
  305.     };
  306.     
  307.  
  308. #define SNMPVersion        0x100        /* used for LAPMIBStats, Dot3Stats, Dot3Entry */